package com.com.knowledgepaymentmanagementsystem.service.course.impl;

import com.com.knowledgepaymentmanagementsystem.mapper.course.ColumnMapper;
import com.com.knowledgepaymentmanagementsystem.pojo.course.Column;
import com.com.knowledgepaymentmanagementsystem.service.course.ColumnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @description: TODO
 * @author: FY
 * @date: 2025/9/22 15:46
 * @version: JDK 8
 **/
@Service
public class ColumnServiceImpl implements ColumnService {

    @Autowired
    private ColumnMapper columnMapper;
    @Override
    public List<Column> getColumn(Column column) {
        return columnMapper.getColumn(column);
    }

    @Override
    public int insertColumns(Column column) {
        column.setCreateTime(LocalDateTime.now());
        return columnMapper.insertColumn(column);
    }

    @Override
    public void updateColumns(Column column) {
        columnMapper.updateColumn(column);

    }

    @Override
    public void deleteColumns(Integer id) {
        columnMapper.delColumnById(id);
    }
}
